<template>
  <panel>
    <el-button @click="doGet">get</el-button>
    <el-button @click="doPost">post</el-button>
    <el-button @click="doPut">put</el-button>
  </panel>
</template>

<script>

  import {testGet, testPost, testPut} from '@/api/demo';
  import httpClient from '../../utils/httpClient';

  export default {
    data() {
      return {};
    },
    methods: {
      doGet: function() {
        console.log('doGet');
        //名字數組裏的函數名詞不能相同
        httpClient(testGet, function(error, results) {
        });
        httpClient([testGet, testGet, testGet], [1, 2, 3], function(error, results) {
        });
        httpClient(testGet, [1432,4321], function(error, results) {
        });
      },
      doPost: function() {
        console.log('doPost');
      },
      doPut: function() {
        console.log('doPut');
      },
    },
  };
</script>
